describe("should be able to build a valid message with oauth info", function(){

	it("should return signature given url ", function(){
		message = new Message("http://api.t.sina.com.cn/oauth/request_token")
		var signature = message.sign();
		
		var params = [
			['oauth_consumer_key', message.consumerKey],
			['oauth_signature_method', 'HMAC-SHA1'],
			['oauth_timestamp', signature.oauth_timestamp],
			['oauth_nonce', signature.oauth_nonce ],
			['oauth_signature', '']
		];
		var msg = { action : "http://api.t.sina.com.cn/oauth/request_token", method : "POST", parameters : params };
		var accessor = { consumerSecret : message.consumerSecret, tokenSecret : message.oauthTokenSecret };
		OAuth.SignatureMethod.sign(msg, accessor);
		var result = OAuth.getParameterMap(msg.parameters);
		
		expect(signature).toEqual(result);
	});
});